import { actionsMap } from '@/constants'

export type StyleBinding = {
  [cssName: string]: string
}

export type Btn = {
  title?: string
  name: string
  id: string
  icon: string
}

export type KeyEvent = {
  ctrlKey: boolean
  shiftKey: boolean
  metaKey: boolean
  key: string
  action: actionsMap
}

export type EventComposition = {
  bind: () => void
  unbind: () => void
}

type FileRef = {
  src: string
  length: number
  in: number
  out: number
  id: string
}

export type Clip = {
  id: string
  name: string
  selected: boolean
  hovering: boolean
  operating: boolean
  src?: string
  thumbnail?: string
  offset: number
  start: number
  tcFormat: string
  duration: number
  ref: FileRef
  format: string
}

export type Spine = {
  name: string
  id: number
  clips: Clip[]
}

export type Sequence = {
  duration: number
  format: number
  tcStart: number
  tcFormat: string
  spines: Spine[]
}

export interface LinkList<T> {
  prev: LinkList<T> | null
  data: T
  next: LinkList<T> | null
}

export interface TimeRange {
  start: number
  end: number
}

// 图标按钮实体
export interface IIconBtn {
  title: string
  icon: string
  click: () => void
  class?: string
}
